<div class="users form">
    {{$this->Html->script(array('jquery/jquery.form.js'))}}
<?php 
echo $this->MForm->create('Uploadfile',array(
	'url' => array('controller'=>'tools','action' => 'uploadoss'),'type'=>'file','id'=>'UploadOssForm','data-noajax'=>true
));
?>

<fieldset>
            
    <div class="tab-content">
            <div id="article-main" class="tab-pane active">
            	 <?php
            	 	echo $this->MForm->input('object_name',array('required'=>'required','label'=> __('Oss Path'),));

                    echo $this->MForm->input('file',array('type'=>'file','label'=> __('File'),));

                    $buckets = explode(',',Configure::read('Storage.alioss_all_buckets'));
                    $options = array();
                    foreach($buckets as $val) {
                        $options[$val] = $val;
                    }

                    echo $this->MForm->input('bucket',array('type'=>'select','options'=>$options,'label'=> __('Bucket'),));
                    
				 ?>
            </div>                	
    </div>
 
    
    <div class="form-group">
    	<label class="col-sm-2 control-label"></label>
    	<div class="col-sm-10 controls"><?php echo $this->MForm->submit(__('Submit'),array('id'=>'btnsubmit')); ?></div>
    </div>
</fieldset>
	{{$this->MForm->end()}}
</div>
<!-- ajax submit file. see document in.  http://jquery.malsup.com/form/ -->
<div id="divToUpdate"></div>
<script>
var options = {
        target:     '#divToUpdate', 
        success:    function() { 
            showSuccessMessage('Add success!'); 
        } 
    }; 
// pass options to ajaxForm 
$('#UploadOssForm').ajaxForm(options);
</script>
